#include <stdio.h>

#define MAXLINE 1000000

int read_numbers(char*, int*, int);
void print_numbers(int*, int);
void sort_numbers(int [], int);

int main(int argc, char* argv[])
{
    if (argc != 2) {
        fprintf(stderr, "Using: ./<filename> to input a file\n");
        return -1;
    }
    int dest[MAXLINE];
    int pos = read_numbers(argv[1], dest, MAXLINE);

    //before sorting
    print_numbers(dest, pos);

    //after sorting
    sort_numbers(dest, pos);
    printf("\nAfter sorting:\n");
    print_numbers(dest, pos); 

    return 0;
}

